from SimpleCV import *

"""
** Gaussian Image Pyramid example
"""
def imagePyramids(filename):
    print '****** Zoom In-Out demo ******'
    try:
        destination_image = Image(filename)
    except:
        print 'Issue in loading the image'
    else:
        destination_image.show()
        zoom_method = raw_input('Do you want to zoom(in/out) : ')
        while zoom_method != 'none':
            if zoom_method == 'in':
                print '** Zoom In: Image x 2'
                destination_image = destination_image.smooth()
                destination_image = destination_image.scale(2.0) 
            elif zoom_method == 'out':
                print '** Zoom Out: Image / 2'
                destination_image = destination_image.smooth()
                destination_image = destination_image.scale(0.5)
            destination_image.show()
            zoom_method = raw_input('Do you want to zoom(in/out) : ')
    return

imagePyramids('lena.png')
